* "Integrating the Use of Statistical Software into Undergraduate Political Methodology Courses". Forthcoming at PS: Political Science & Politics
*
* Brown, Bryant and Philips. Aug 2021.
*
* code to replicate the survey portion of Tables 1, 2 and 3 and create Figure 2
* ----------------------------------------------------

use "survey-replication.dta", clear
tab unitype // details about uni types in intro.

* ------------- TABLE 1 --------------------
* % Usage column
tabstat excel pythons rstudio spss stata other if Q16 != "", s(n mean) format(%14.2fc)

* "Which software package would you guess is used most often in courses like yours?" (%) column
tab Q16 if excel != .

* % of users that would recommend their software to a colleague column
tab Q19 if Q16 != "" & excel == 1 // excel
tab Q19 if Q16 != "" & pythons == 1 // python
tab Q19 if Q16 != "" & rstudio == 1 // R/RStudio
tab Q19 if Q16 != "" & spss == 1 // SPSS
tab Q19 if Q16 != "" & stata == 1 // Stata
tab Q19 if Q16 != "" & other == 1 // other
* ------------------------------------------

* ------------- TABLE 2 --------------------
* percentage that include a topic column:
tabstat researchdesign ols dichotomousdv descriptstat hypothesis anovatesting clt datamanagement graphics programming, s(n mean) format(%14.2fc)
* ------------------------------------------


* ------------- TABLE 3 --------------------
* assessment types column:
tabstat problemsets papers presentations groupproblem examanysort, s(n mean) format(%14.2fc)
* ------------------------------------------


* ------------- FIGURE 2 -------------------
ssc install scheme-burd, replace
set scheme burd 
su uglevel
local N = r(N)
graph bar , over(uglevel, label(angle(45)))  title("Course Level") note("N = `N'")
graph export "figure2.tif", as(tif) replace
tab uglevel
* ------------------------------------------

